package com.wxy.demo.design_pattern.strategy;

/**
 * <p>
 * 策略模式
 * </p>
 *
 * @author e-Xiaoyuan.Wang
 * @since 2022/11/2 17:51
 */
public class Demo {
    public static void main(String[] args) {
        Context context = new Context(new OperationAdd());
        System.out.println(context.executeStrategy(5, 5));

        Context context1 = new Context(new OperationMultiply());
        System.out.println(context1.executeStrategy(5, 5));

        Context context2 = new Context(new OperationSubtract());
        System.out.println(context2.executeStrategy(5, 5));
    }
}
